<?php
namespace Admin\Form;
use Zend\Form\Form;
use Zend\Form\Element;

class LoginForm extends Form{
	public function __construct($name = ''){
		parent::__construct('Login');
		$this->setAttribute('method','POST');
		$this->setAttribute('enctype','multipart/form-data');

		$this->add(array(
			'name' => 'username',
			'attributes' => array(
				'type' => 'text',
				'required' => 'required',
				'id' => 'username',
				'class' => 'form-control',
			),
			'options' => array(
				'label' => 'Tài khoản',
				'label_attributes' => array(
					'class'=>'col-sm-4 control-label',
				),
			),
			'filters' => array(
				array('name'=>'StringTrim'),
			),
		));

		$this->add(array(
			'name' => 'password',
			'attributes' => array(
				'type' => 'password',
				'required' => 'required',
				'id' => 'password',
				'class' => 'form-control',
			),
			'options' => array(
				'label' => 'Mật khẩu',
				'label_attributes' => array(
					'class'=>'col-sm-4 control-label',
				),
			),
			'filters' => array(
				array('name'=>'StringTrim'),
			),
		));

		$this->add(array(
    		  	'name'=>'remember',
    		  	'type'=>'checkbox',
    		  	'attributes'=>array(
    				'id'=>'remember',
    			),
    			'options'=>array(
    				'label' => '&nbsp; Ghi nhớ?',
    				'checked_value' => 1,
    				'unchecked_value' => 0
    			)
    	));

		$this->add(array(
    		  'name'=>'submit',
    		  'attributes'=>array(
    				'type'=>'submit',
    				'value'=>'Đăng nhập',
    				'id'=>'submit',
    				'class'=>'form-control',
    				'class'=>'btn btn-primary',
    			),
    	));
	}
}